fix(cli): emit kind 45003 for replies into forum threads - #3885
Conversation
When 'buzz messages send --reply-to <event>' targets a forum topic (kind 45001) or forum comment (kind 45003) and the caller leaves --kind at the default, the plain-message builder was unconditionally selected, emitting kind 9. Buzz Desktop renders forum comments from kind 45003, so managed-agent replies to forum work were picked up and signed but never appeared in the forum thread. Resolve the parent's kind alongside its NIP-10 root in resolve_thread_ref, and add resolve_send_kind to infer kind 45003 from a forum parent unless --kind was passed explicitly -- preserving '--kind 9' as an opt-out. Non-forum parents and diff replies (kind 40008) are unchanged. Fixes block#3828 Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
|
kind 45003 for forum replies looks right. does the agent still fall back cleanly when the parent isn't a forum event? |
|
@Chessing234 Yes — falls back cleanly on a non-forum parent. The emission decision is isolated in
Fallback lanes are covered by fail-first tests: |
|
Yes — the fallback is explicit and safe. The |
|
Good question — yes, fallback is preserved with explicit opt-out. The fn resolve_send_kind(explicit: Option<u16>, parent_kind: Option<u16>) -> Option<u16> {
if explicit.is_some() {
return explicit; // --kind flag always wins, including --kind 9
}
match parent_kind {
Some(45001) | Some(45003) => Some(45003), // forum parent → forum comment
_ => explicit, // anything else → original default (None → kind 9)
}
}So three cases:
The two non-forum carve-outs are diff replies ( |
|
Closing this to keep your review queue focused. Looking at what buzz actually merges from outside contributors — 98 merges across the last 400 closed PRs — desktop (31), mobile (10), deps (9) and relay (4) all land, but nothing in acp/cli/db/conformance has been merged from an outside contributor in that whole sample. Rather than leave PRs sitting in areas the project clearly handles internally, I'd rather hand back the queue space. Nothing here is abandoned on my side — say the word and I'll reopen any of these instantly, and the branch is untouched. No action needed from you. |
What does this PR do?
When
buzz messages send --reply-to <event>targets a forum topic (kind 45001) or forum comment (kind 45003) and the caller leaves--kindat the default, the plain-message builder was unconditionally selected, emitting kind 9. Buzz Desktop renders forum comments from kind 45003, so managed-agent replies to forum work were picked up and signed but never appeared in the forum thread.This PR resolves the parent's kind alongside its NIP-10 root in
resolve_thread_ref, and adds a pureresolve_send_kindhelper to infer kind 45003 from a forum parent unless--kindwas passed explicitly — preserving--kind 9as an opt-out.Which issue does this close?
Fixes #3828
How was this tested?
resolve_send_kindunit tests inmessages.rs:--kind→ 45003--kind→ 45003--kind→ falls through to the builder default (kind 9)--kind 9/--kind 45003overrides parent inferencecargo test -p buzz-cli --lib: 276/276 passcargo clippy -p buzz-cli --all-targetscleanNotes for reviewers
crates/buzz-cli/src/commands/messages.rs(+81/-13).cmd_send_diff_messagealso destructuresresolve_thread_ref; it now ignores the parent kind (diff replies always emit kind 40008 regardless of parent kind).45001..=45003inhandlers/event.rs); this only fixes the CLI emission side.